package com.xxx.untils;


import com.alibaba.fastjson.JSONObject;
import com.xxx.domain.Login;
import org.springframework.security.core.context.SecurityContextHolder;

public class LoginContext {
    public static Login getLogin() {

        String string = SecurityContextHolder.getContext().getAuthentication().getPrincipal().toString();
        return JSONObject.parseObject(string, Login.class);
    }
}
